#ifndef MAIN_WINDOW_H
#define MAIN_WINDOW_H

#include <QMainWindow>

#include <QMap>
#include <QModelIndex>
#include <QString>

#include "texture_pack.h"

namespace Ui {
class MainWindow;
}

class AppStateModel;
class TileTableDelegate;
class TileTableModel;
class MainWindow : public QMainWindow {
  Q_OBJECT

 public:
  explicit MainWindow(AppStateModel* app_state, QWidget* parent = NULL);
  ~MainWindow();

 public slots:
  void chooseTexturePackToAdd();
  void chooseSaveFilenameForMergedPack();
  void setDefaultPack(int index);
  void showAboutBox();

 private slots:
  void chooseNextPack(QModelIndex index);
  void switchFiles(QString filename);
  void setScaleFactor(int factor);
  void setTableBackground(QColor color);
  void addTexturePack(const QString& path);
  void saveMergedTexturePack(const QString& file_name);

 private:
  TileTableModel* tileModelForTileSheet(QString filename);
  AppStateModel* app_state_model_;
  TileTableDelegate* tile_delegate_;
  QMap<QString, TileTableModel*> tile_models_;
  TileTableModel* current_tile_model_;
  Ui::MainWindow* ui;
};

#endif // MAIN_WINDOW_H
